"""
http://192.168.239.129:38000/api2/auth-token/  #1
http://192.168.239.129:38000/api2/account/info/  #2
http://192.168.239.129:38000/api2/repos/   #3
http://192.168.239.129:38000/api2/repos/   #4
http://192.168.239.129:38000/api2/repos/1.3查询到的repoid/?op=rename  #5
http://192.168.239.129:38000/api2/repos/id(1.4接口里查到的资料库id值)/  #6
http://192.168.239.129:38000/api2/repos/资料库id/file/?p=/aaa&reloaddir=true #7
http://192.168.239.129:38000/api2/repos/资料库id/file/?p=/aaa&reloaddir=true  #8
"""
ip_port='http://192.168.239.129:38000/'
def get_url_info(login_id,repo_id='',zlk_id='',file_name=''):
    if login_id==1:
        url=ip_port+'api2/auth-token/'
        return url
    elif login_id==2:
        url=ip_port+'api2/account/info/'
        return url
    elif login_id==3 or login_id==4:
        url=ip_port+'/api2/repos/'
        return url
    elif login_id==5:
        url=ip_port+f'api2/repos/{repo_id}/?op=rename'
        return  url
    elif login_id==6:
        url=ip_port+f'api2/repos/{zlk_id}/'
        return url
    elif login_id==7 or login_id==8:
        url=ip_port+f'api2/repos/{zlk_id}/file/?p=/{file_name}&reloaddir=true'
        #http://192.168.239.129:38000/api2/repos/资料库id/file/?p=/aaa&reloaddir=true  #8
        return url






host = 'http://192.168.239.129:38000/'

path_login_1 = 'api2/auth-token/'
path_info_2 = 'api2/account/info/'
path_add_or_select_3_4 = 'api2/repos/'


def get_path_5_6_7_8(id, x, file_name=''):
    # x代表接口编号
    if x == 5:
        # http://192.168.239.129:38000/api2/repos/1.4查询到的repoid/?op=rename
        path_modify = host + f'api2/repos/{id}/?op=rename'
        return path_modify
    elif x == 6:
        # http://192.168.239.129:38000/api2/repos/id(1.4接口里查到的资料库id值)/
        path_delete = host + f'api2/repos/{id}/'
        return path_delete
    elif x == 7 or x == 8:
        # http://192.168.239.129:38000/api2/repos/资料库id/file/?p=/aaa&reloaddir=true
        path_add_file = host + f'api2/repos/{id}/file/?p=/{file_name}&reloaddir=true'
        return path_add_file

